home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-11 / drivel.zip / GETPATH.C < prev    next >
Text File  |  1993-01-04  |  1KB  |  45 lines

  1. /* getpath.c                                */
  2. /* compile with MSC 5.0 or above:            */
  3.  
  4. /* cl /c /AL /Zl /FPa /Gs /Ox /W3 getpath.c */
  5.  
  6. #include "nandef.h"                 /* Nantucket C define's        */
  7. #include "extend.h"                 /* Clipper Extend declarations */
  8.  
  9. extern int CurrPath(char *);         /* Microsoft ASM routine       */
  10. CLIPPER GetPath(void);
  11.  
  12. /*
  13.     Function:       GetPath
  14.     Parameters:     None
  15.     Returns:        char * - the current path using the Clipper Summer 87 method
  16.     Author:         Mike Taylor
  17.     Date:           16 December 1988
  18.  
  19.     Description:    Returns to a Clipper caller the current path
  20.  
  21.     Called By:      Clipper Summer 87 code
  22. */
  23.  
  24. CLIPPER GetPath()
  25. {
  26.     char CurrentPath[65];
  27.     int  i;
  28.  
  29.     /* get the current path from DOS */
  30.  
  31.     i = CurrPath(CurrentPath);
  32.  
  33.     if ( i == 0 )    /* no error returned from CurrPath */
  34.     {
  35.         for (i = 65; i > 0; i--)                    /* insert space at start */
  36.             CurrentPath[i] = CurrentPath[i - 1];
  37.  
  38.         CurrentPath[0] = '\\';                      /* add leading \\        */
  39.     }
  40.     else
  41.         CurrentPath[0] = '\0';
  42.  
  43.     _retc( CurrentPath );
  44. }
  45.